home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / mfpic / setup / unix / setups.tex < prev   
Text File  |  1992-09-06  |  5KB  |  143 lines

  1. %%%
  2. %%%  File:  setups.tex
  3. %%%
  4.  
  5. % abbreviations
  6. \def\LaTeX{{\rm L\raise.42ex\hbox{\kern-.3em a}\kern-.15em\TeX}}
  7. \def\PiCTeX{{\rm P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\kern-.11em\TeX}}
  8. \font\manual=logo10 % may want to use manfnt here instead
  9. \def\MF{{\manual META}\-{\manual FONT}}
  10. \def\PS{{\rm Post}\-{\rm Script}}
  11.  
  12.  
  13. \noindent{\it Setting up on {\tt UNIX}.} 
  14.  
  15. This document explains how to set up {\tt mfpic} on one specific
  16. configuration of
  17. machine -- a {\tt UNIX} machine running {\tt csh} and X Windows, with a \PS\
  18. compatible printer.  In particular, this document explains how to set
  19. up the {\tt UNIX}
  20. environment variables for \TeX, \MF, {\tt dvips}, and {\tt xdvi} (which
  21. is a DVI
  22. viewer for X Windows).  Many of these procedures will be necessary, in
  23. some form or
  24. another, on most machines.
  25.  
  26. Look at the case of processing the sample file {\tt pictures.tex}. 
  27. \TeX\ generates a
  28. Metafont file {\tt pics.mf}.  Then processing {\tt pics.mf} with \MF\ 
  29. (using the {\tt UNIX} command ``{\tt mf '\string\mode=localfont; input
  30. pics'}") 
  31. generates  the files
  32. {\tt pics.tfm} and {\tt pics.360gf} (since {\tt pictures.tex} includes
  33. the command 
  34. {\tt \string\magnification=\string\magstep1}).  However, when you run
  35. \TeX\ again on 
  36. {\tt pictures.tex}, \TeX\ still can't find the file {\tt pics.tfm}. 
  37. This is because
  38. the system default for the {\tt UNIX} path environment variable {\tt
  39. TEXFONTS} doesn't
  40. include the current directory.  This is, in fact, the problem with most of the
  41. relevant environment variables -- \TeX\ can't find {\tt pics.tfm}
  42. because of the 
  43. {\tt TEXFONTS} environment variable, {\tt xdvi} can't find {\tt
  44. pics.360gf} because of
  45. the {\tt XDVIFONTS} environment variable, etc.  All of the relevant
  46. variables can be
  47. set up properly by installing the {\tt mfpicsetup} script below and
  48. then typing 
  49. ``{\tt source mfpicsetup}" at the command prompt (or including this
  50. command in your
  51. {\tt .cshrc} file).
  52.  
  53. There is a more serious problem, though.  The printing command ``{\tt
  54. lpr -d}" 
  55. (``{\tt -d}" is the DVI printing option) will
  56. not find local fonts, and there is no environment variable you can
  57. change to make it
  58. find them.  The best thing to do in this case is to convert your DVI
  59. file to \PS\
  60. format using {\tt dvips}, then print the \PS\ file.  But {\tt dvips}
  61. uses fonts in PK
  62. (packed pixel) format, not the GF (generic font) format that \MF\
  63. generates.  So you
  64. need to run {\tt gftopk} in the file {\tt pics.360gf}.  There are
  65. scripts included
  66. below to make all of these processes easier.
  67.  
  68. The scripts included here are all {\tt csh} scripts.  You should save
  69. them in one of
  70. the directories that your {\tt PATH} environment variable points to. 
  71. The first script
  72. sets up the environment variables so that \TeX, {\tt xdvi}, and {\tt
  73. dvips} can all
  74. find the fonts generated by \MF\ in the current directory.  You should
  75. save this
  76. script as ``{\tt mfpicsetup}", then include the line ``{\tt source
  77. mfpicsetup}" in
  78. your {\tt .cshrc} file.  The last line of this script makes sure that
  79. {\tt xdvi} looks
  80. for the font in the appropriate resolution.
  81.  
  82. \par{\tt \#!/bin/csh}
  83. \par{\tt set A=\$TEXFONTS}
  84. \par{\tt setenv TEXFONTS .:\$A}
  85. \par{\tt set A=\$TEXPKS}
  86. \par{\tt setenv TEXPKS .:\$A}
  87. \par{\tt set A=\$XDVIFONTS}
  88. \par{\tt setenv XDVIFONTS .:\$A}
  89. \par{\tt alias xdvi 'xdvi -p 300 -s 3'}
  90.  
  91. \noindent
  92. The next script allows you to process a \TeX\ file containing {\tt mfpic}
  93. commands and generate the fonts all in one step.  It will automatically
  94. go through the
  95. first two steps (processing with \TeX\ and processing with \MF) -- with the 
  96. ``{\tt -n}" option (mnemonic for ``new file"), it will also include the
  97. third step,
  98. reprocessing with \TeX.  You must include {\it both} the name of the
  99. \TeX\ file and
  100. the name of the \MF\ file it generates.    You should save this
  101. script as ``{\tt domfpic}" -- then, for example, the command 
  102.  
  103. \par{\tt domfpic -n pictures pics}
  104.  
  105. \noindent will go through all three steps for {\tt pictures.tex},
  106. generating the files
  107. {\tt pictures.dvi}, {\tt pics.mf}, {\tt pics.tfm}, and {\tt
  108. pics.360gf}.  This will
  109. allow you to view {\tt pictures.dvi} with {\tt xdvi}.
  110.  
  111. \par{\tt \#!/bin/csh}
  112. \par{\tt set OPT=-n}
  113. \par{\tt if (\$1 == \$OPT) then}
  114. \par{\tt tex \$2}
  115. \par{\tt mf '\string\mode=localfont;' input \$3}
  116. \par{\tt tex \$2}
  117. \par{\tt else}
  118. \par{\tt tex \$1}
  119. \par{\tt mf '\string\mode=localfont;' input \$2}
  120. \par{\tt endif}
  121.  
  122. \noindent 
  123. The next script does the printing -- so it includes the {\tt gftopk} and
  124. {\tt dvips} steps, along with an {\tt lpr} command.  Again, you must include 
  125. {\it both} the name of the \TeX\ file and the name of the \MF\ file it
  126. generates --
  127. but this time you absolutely {\it cannot} include the subscripts {\tt
  128. .tex} and 
  129. {\tt mf}.   This script also cleans up after itself by removing the PK
  130. and \PS\ files 
  131. when it is done.  You should save this script as ``{\tt prmfpic}".
  132.  
  133. \par{\tt \#!/bin/csh}
  134. \par{\tt foreach B (\$2.*gf)}
  135. \par{\tt gftopk -v \$B}
  136. \par{\tt end}
  137. \par{\tt dvips -Z \$1.dvi}
  138. \par{\tt lpr \$1.ps}
  139. \par{\tt rm \$2.*pk}
  140. \par{\tt rm \$1.ps}
  141.  
  142. \end
  143.